home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
476-500
/
disk_499
/
diglib
/
diglib.lzh
/
source
/
DEVSEL.for
< prev
next >
Wrap
Text File
|
1991-04-13
|
2KB
|
101 lines
SUBROUTINE DEVSEL(NEWDEV,LUN,IERR)
INTEGER NEWDEV,LUN,IERR
IMPLICIT NONE
C
C
INCLUDE DIGLIB$KOM:GCDSEL.PRM
INCLUDE DIGLIB$KOM:GCDPRM.PRM
INCLUDE DIGLIB$KOM:GCCPAR.PRM
INCLUDE DIGLIB$KOM:GCVPOS.PRM
INCLUDE DIGLIB$KOM:GCCPOS.PRM
INCLUDE DIGLIB$KOM:GCCLIP.PRM
INCLUDE DIGLIB$KOM:GCDCHR.PRM
INCLUDE DIGLIB$KOM:GCLTYP.PRM
REAL*4 DEVCHR(8), GDCOMN(5), DUMMY
REAL*4 DFDIST(4,3),GOODCS,XCUR,YCUR
INTEGER I,J
C
C DEFINE DEFAULT LINE STYLES
C
EQUIVALENCE (DEVID,GDCOMN(1))
DATA DFDIST /
1 0.5, 0.5, 0.5, 0.5,
2 0.25, 0.25, 0.25, 0.25,
3 0.5, 0.25, 0.25, 0.25/
DATA DUMMY /0/
C
C RELEASE CURRENT DEVICE
C
IF (IDEV .NE. 0) CALL GSDRVR(6,DUMMY,DUMMY)
C
C NOW INIT. THE NEW DEVICE
C
IF (NEWDEV .LE. 0) GO TO 900
IDEV = NEWDEV
C
C INITIALIZE THE DEVICE FOR DIGLIB GRAPHICS
C
CALL GSDRVR(1,FLOAT(LUN),DUMMY)
IERR = DUMMY
IF (IERR .NE. 0) GO TO 910
C
C GET THE DEVICE CHARACTERISTICS
C
DEVCHR(8) = 1.0
CALL GSDRVR(7,DEVCHR,DUMMY)
IF (DEVCHR(1) .EQ. 0.0) GO TO 900
C
C SET DEVICE CHARACTERISTICS FOR LATER USE
C
DO 100 I=1,5
100 GDCOMN(I) = DEVCHR(I)
XLENCM = DEVCHR(2)
YLENCM = DEVCHR(3)
XRES = DEVCHR(4)
YRES = DEVCHR(5)
NDCLRS = DEVCHR(6)
IDVBTS = DEVCHR(7)
NFLINE = DEVCHR(8)
XCLIPD = XLENCM + 0.499/DEVCHR(4)
YCLIPD = YLENCM + 0.499/DEVCHR(5)
C
C NOW INIT THE PARAMETERS
C
XS = 1.0
YS = 1.0
XT = 0.0
YT = 0.0
RCOS = 1.0
RSIN = 0.0
CSIZE = GOODCS(0.3)
CCOS = 1.0
CSIN = 0.0
XCUR = 0.0
YCUR = 0.0
IVIS = 0
XCM0 = 0.0
YCM0 = 0.0
XCM1 = XCLIPD
YCM1 = YCLIPD
ILNTYP = 1
DO 120 I=1,3
DO 110 J=1,4
DIST(J,I) = DFDIST(J,I)
110 CONTINUE
120 CONTINUE
LCURNT = .FALSE.
RETURN
C
C NON-EXISTANT DEVICE SELECTED, REPORT ERROR AND DESELECT DEVICE
C
900 IERR = -1
C
C DEVICE INITIALIZATION FAILED, DESELCT DEVICE
C
910 IDEV = 0
RETURN
END